#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "GameModel.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected:
    void paintEvent(QPaintEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
private slots:
    void chessOneByAI();

private:
    void initGames();
    void initAIGames();

    void chessOneByPerson();//由人来下棋
    void haveWinner(int row,int col);

private:
    Ui::MainWindow *ui;

    GameModel *game;//游戏指针
    GameType game_type;//存储游戏类型

    //绘制点点
    int m_drawPosx;
    int m_drawPosy;
    int m_posRow;
    int m_posCol;
    bool m_needPoint;

    //新的游戏
    bool startNewGame;
};
#endif // MAINWINDOW_H
